<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>获取 Mall ID</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      width: 400px;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      padding: 0;
    }

    .container {
      background: white;
      padding: 20px;
    }

    h1 {
      color: #333;
      font-size: 20px;
      margin-bottom: 20px;
      text-align: center;
    }

    .mall-id-display {
      background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      color: white;
      padding: 20px;
      border-radius: 12px;
      text-align: center;
      margin-bottom: 20px;
      display: none;
    }

    .mall-id-display.show {
      display: block;
    }

    .mall-id-display .name {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 15px;
      opacity: 0.95;
    }

    .mall-id-display .label {
      font-size: 14px;
      opacity: 0.9;
      margin-bottom: 8px;
    }

    .mall-id-display .id {
      font-size: 32px;
      font-weight: bold;
      font-family: 'Courier New', monospace;
      margin: 10px 0;
      word-break: break-all;
    }

    .button {
      width: 100%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      border: none;
      padding: 15px;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
      margin-bottom: 10px;
    }

    .button:hover {
      transform: translateY(-2px);
      box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

    .button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .status {
      padding: 12px;
      border-radius: 8px;
      margin-bottom: 15px;
      text-align: center;
      font-size: 14px;
      display: none;
    }

    .status.show {
      display: block;
    }

    .status.loading {
      background: #fff3cd;
      color: #856404;
      border: 1px solid #ffc107;
    }

    .status.success {
      background: #d4edda;
      color: #155724;
      border: 1px solid #28a745;
    }

    .status.error {
      background: #f8d7da;
      color: #721c24;
      border: 1px solid #dc3545;
    }

    .status.warning {
      background: #fff3cd;
      color: #856404;
      border: 1px solid #ffc107;
    }

    .info {
      background: #e7f3ff;
      border-left: 4px solid #2196F3;
      padding: 12px;
      border-radius: 4px;
      margin-bottom: 15px;
      font-size: 13px;
      color: #0c5460;
    }

    .copy-btn {
      background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
      font-size: 14px;
      padding: 10px;
      margin-top: 10px;
    }

    .loading-spinner {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 3px solid rgba(255,255,255,.3);
      border-radius: 50%;
      border-top-color: #fff;
      animation: spin 1s ease-in-out infinite;
      margin-right: 8px;
      vertical-align: middle;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>🏪 拼多多 Mall ID 获取</h1>

    <div id="status" class="status"></div>

    <div id="mallIdDisplay" class="mall-id-display">
      <div class="name" id="mallNameValue">店铺名称</div>
      <div class="label">Mall ID</div>
      <div class="id" id="mallIdValue">-</div>
      <button class="button copy-btn" id="copyBtn">📋 复制 Mall ID</button>
    </div>

    <div class="info">
      <strong>使用说明：</strong><br>
      1. 确保已登录拼多多商家后台<br>
      2. 点击下方按钮获取店铺信息<br>
      3. 店铺名称和 Mall ID 会自动显示并可复制
    </div>

    <button class="button" id="getMallIdBtn">
      🎯 获取店铺信息
    </button>
  </div>

  <script src="popup_simple.js"></script>
</body>
</html>

